Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: jwt.decode doesn't throw, check null instead #321

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

glensc
Copy link
Contributor

@glensc glensc commented Feb 6, 2023

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

I can not find from jsonwebtoken.decode where it would throw:

but it does return null, which was not checked.

The same goes for jws.decode, it returns null rather than throwing:

Checklist

  • This change adds test coverage for new/changed/fixed functionality
  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not the default branch

@glensc glensc changed the title Fix: jwt.decode does throw, check null instead Fix: jwt.decode doesn't throw, check null instead Feb 6, 2023
@glensc
Copy link
Contributor Author

glensc commented Feb 6, 2023

jws.decode has one code path that can throw:

that should be merged first.

@glensc glensc mentioned this pull request Feb 6, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant